package it.pecuswap.client.rest.service;

import it.pecuswap.client.rest.ClientProvider;
import it.pecuswap.commons.client.rest.interfaces.RegistrazioneServiceInterface;
import it.pecuswap.commons.client.rest.parameters.CompleteRegistrationParameter;
import it.pecuswap.commons.dto.UtentiDTO;
import it.pecuswap.commons.exceptions.PecuswapRestException;
import it.pecuswap.exceptions.ConfigurationException;

public class RegistrazioneServiceClient extends ClientProvider implements RegistrazioneServiceInterface  {
	
	private RegistrazioneServiceInterface registrazioneServiceInterface = null;

	public RegistrazioneServiceClient() throws ConfigurationException{
		registrazioneServiceInterface = super.serviceClientInterfaceProvider(RegistrazioneServiceInterface.class);
	}

	@Override
	public boolean existUsername(String userName) throws PecuswapRestException {
		return registrazioneServiceInterface.existUsername(userName);
	}

	@Override
	public long registerUser(UtentiDTO utenteDTO) throws PecuswapRestException {
		return registrazioneServiceInterface.registerUser(utenteDTO);
	}

	@Override
	public void completeRegistration(CompleteRegistrationParameter param) 
			throws PecuswapRestException{
		registrazioneServiceInterface.completeRegistration(param);
	}
	
}
